package Entity;

public class Rank implements Comparable {

    public Double susp;
    public int stmt;

    public Rank() {
        susp = 0.0;
        stmt = -1;
    }

    public Rank(Double _s, int _st) {
        susp = _s;
        stmt = _st;
    }

    public int compareTo(Object o) {
        Rank e = (Rank) o;

        int result = this.susp.compareTo(e.susp);

        if (result < 0) {
            return 1;
        } else if (result == 0) {
            if (this.stmt > e.stmt) {
                return 1;
            } else {
                return 0;
            }
        } else if (result <= 0) {
            return -1;
        }

        return -2;
    }

    public String toString() {
        return susp + "\t" + stmt;
    }
}